/**
 * TOPCODER SRM 513 Division II Level 1 (250 points)
 * http://community.topcoder.com/stat?c=problem_statement&pm=11499&rd=14538
 */

package topcoder;

public class TrainingCamp {

	public String[] determineSolvers(String[] attendance, String[] problemTopics){
		int N = attendance.length;
		int M = attendance[0].length();
		int K = problemTopics.length;
		
		String[] r = new String[N];
		for(int i=0; i<N; i++){
			r[i] = "";
			for(int j=0; j<K; j++){
				boolean pass = true;
				for(int k=0; k<M; k++){
					if(problemTopics[j].charAt(k) == 'X' && attendance[i].charAt(k) != 'X'){
						pass = false;
						break;
					}
				}
				if(pass)
					r[i] += 'X';
				else
					r[i] += '-';
			}
		}
		
		return r;
	}
}
